package com.rong.shop.utils;

import java.io.Serializable;

public class JsonResult<E> implements Serializable {

    // 状态码
    private int state;
    // 描述信息
    private String msg;
    // 数据
    private E data;

    public JsonResult(){}

    public JsonResult(int state) {
        this.state = state;
    }

    public JsonResult(Throwable e) {
        this.msg = e.getMessage();
    }

    public JsonResult(int state, E data) {
        this.state = state;
        this.data = data;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;
    }

}
